import { defHttp } from "@/utils/http";
// ERP 单据类型 VO
export interface DocTypeVO {
	id: number; // 主键,示例值(25542)
	name: string; // 单据类型名称,示例值(赵六)
	parentId: number; // 父级ID,示例值(11272)
	sqNumb: number; // 序号
	whsId: string; // 仓库,示例值(11869)
	fundingId: string; // 来源配置,示例值(12485)
	bizId: number; // 对象代码,示例值(22391)
}

// ERP 单据类型 API
export const DocTypeApi = {
	// 查询单据类型分页
	getDocTypePage: async (params: any) => {
		return await defHttp.get({ url: `/whs/receipt-type/page`, params });
	},

	// 查询单据类型详情
	getDocType: async (id: number) => {
		return await defHttp.get({ url: `/whs/receipt-type/get?id=` + id });
	},

	// 新增单据类型
	createDocType: async (data: DocTypeVO) => {
		return await defHttp.post({ url: `/whs/receipt-type/create`, data });
	},

	// 修改单据类型
	updateDocType: async (data: DocTypeVO) => {
		return await defHttp.put({ url: `/whs/receipt-type/update`, data });
	},

	// 删除单据类型
	deleteDocType: async (id: number) => {
		return await defHttp.delete({ url: `/whs/receipt-type/delete?id=` + id });
	},

	// 导出单据类型 Excel
	exportDocType: async (params: any) => {
		return await defHttp.download({ url: `/whs/receipt-type/export-excel`, params });
	}
};
